<?php
/**
 * 视图管理
 */

namespace backend\controllers;


use common\models\View;

class ViewController extends CommonController
{
    public function actionIndex()
    {
        $this->setQuery(View::find());
        return $this->query();
    }

    public function actionCreate()
    {
        $model = new View();
        $this->setModel($model);
        return $this->save();
    }

    public function actionUpdate($id)
    {
        $model = View::findOne($id);
        $this->setModel($model);
        return $this->save();
    }

    public function actionDelete()
    {
        $this->setModel(new View());
        $this->delete();
    }
}